<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title> object </title>
  <meta charset='UTF-8'>
  <script type='text/javascript' src='Obj.js'></script>
  <script type="text/javascript">
  	window.onload = function(){
		var but = document.getElementById('but');
		var but2 = document.getElementById('but2');
		
		var timer;
		//var i = 1;
		but.onclick = function(){ 
			this.disabled = true;//禁用
			/*timer = setInterval(function(){//设定周期
				console.log('跑起来');
				//i++;
			},1000);*/
			timer = setTimeout("alert('22')",500);//设定时间弹出
		}
		but2.onclick = function(){
			/*but.disabled = false;//
			clearInterval(timer);//暂停周期*/
			clearTimeout(timer);//清除弹出
		}
		
		
		//alert(eval(3+3*10));//计算
		//eval('alert(3+3*10)');///
		//console.log(Math.ceil(2.1));//取上
		//console.log(Math.floor(6.6));//取下
		//console.log(Math.round(5.8));//四舍五入
		//console.log(Math.max(10,20));//最大数
		//console.log(Math.min(10,20));//最小数
		//console.log(parseInt(Math.random()*9000+100));//随机数
		
		var d = new Date();
		d.setTime(888888);
		//d.setFullYear(1992,9,22);
		//d.setMilliseconds(8);
		//d.setSeconds(8);
		//d.setMinutes(8);
		//d.setHours(8);
		//d.setDate(11);
		//d.setMonth(11);
		//console.log(d.getMilliseconds());
		//console.log(d.getSeconds());
		//console.log(d.getMinutes());
		//console.log(d.getHours());
		//console.log(d.getDate());
		//console.log(d.getMonth()+1);
		console.log(d.getTime());
		//console.log(d.toLocaleString());
		//console.log(d.toLocaleTimeString());
		//console.log(d.toLocaleDateString());
		
		/*var arr = [2,52,16,8,3];
		alert(arr.join("-"));//链接*/
		//arr.splice(1,2,'san1','san2','qq');//删除替换
		/*arr.sort(fun);//排序
		function fun(a,b){
			return b-a;
		}*/
		//arr.push(88,'aa');//添加
		//console.log(arr);
		/*try{
			var res = funa(2,2);
			alert('结果：'+res);
		}catch(r){
			//console.log(r.message);//返回错误消息
			alert(r.message);
		}
		*/
		//var i = new Object();//创对象
		/*var i = {};
		i.a = 5;
		i.b = '这是B';
		console.log(i);
		for(var v in i){//查所有属性
			console.log(v);
		}*/
		//console.log('a' in i);//检测是否有属性
		/*delete(i.a);
		console.log(i);*/
		/*
		function fun(name,sex,age){//构造器建对象
			this.name = name;
			this.sex = sex;
			this.age = age;
			this.toString = '年龄为--'+this.age;
		}
		var i = new fun('张三',true,20);//添加属性*/
		/*for(var q in i){//查所有属性
			console.log(q);
		}*/
		//console.log(i.age);//查指定属性
	}
  </script>
 </head>
 <body>
  hello world!
  	<button id='but'>按钮1</button>
  	<button id='but2'>按钮2</button>
 </body>
</html>
